package com.ssy.lingxi.product.repository.warehouse;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.model.response.warehouse.WarehouseResponse;
import com.ssy.lingxi.product.entity.Brand;
import com.ssy.lingxi.product.entity.warehouse.Warehouse;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WarehouseRepository extends JpaRepository<Warehouse, Long> {

    Page<Warehouse> findByMemberIdAndMemberRoleIdAndNameContainingOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, String name, Pageable page);

    Page<Warehouse> findByMemberIdAndMemberRoleIdOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, Pageable page);

    List<Warehouse> findByMemberIdAndMemberRoleIdAndStateOrderByUpdateTimeDesc(Long memberId, Long memberRoleId, Integer state);
}
